package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.cnswhy.cloud.server.common.entity.enumeration.SubWalletType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.cnswhy.cloud.server.common.entity.enumeration.WalletType;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-14
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_customer_wallet")
@ApiModel(value = "CustomerWallet", description = "")
@AllArgsConstructor
public class CustomerWallet extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 客户ID
     */
    @ApiModelProperty(value = "客户ID")
    @NotNull(message = "客户ID不能为空")
    @TableField("customer_id")
    @Excel(name = "客户ID")
    private Long customerId;

    /**
     * 钱包类型 #WalletType{BALANCE:余额;COUPON:拼购券;SPELL_VALUE:拼购券;SPELL_VALUE:拼团值;CONTRIBUTION_VALUE:贡献值;SPELL_BALANCE:拼团收益;CONTRIBUTION_BALANCE:拼团收益;LOVE_BALANCE:爱心收益;SHARE_BALANCE:分享收益;}
     */
    @ApiModelProperty(value = "钱包类型 #WalletType{BALANCE:余额;COUPON:拼购券;SPELL_VALUE:拼购券;SPELL_VALUE:拼团值;CONTRIBUTION_VALUE:贡献值;SPELL_BALANCE:拼团收益;CONTRIBUTION_BALANCE:拼团收益;LOVE_BALANCE:爱心收益;SHARE_BALANCE:分享收益;}")
    @NotNull(message = "钱包类型 #WalletType{BALANCE:余额;COUPON:拼购券;SPELL_VALUE:拼购券;SPELL_VALUE:拼团值;CONTRIBUTION_VALUE:贡献值;SPELL_BALANCE:拼团收益;CONTRIBUTION_BALANCE:拼团收益;LOVE_BALANCE:爱心收益;SHARE_BALANCE:分享收益;}不能为空")
    @TableField("wallet_type")
    @Excel(name = "钱包类型 #WalletType{BALANCE:余额;COUPON:拼购券;SPELL_VALUE:拼购券;SPELL_VALUE:拼团值;CONTRIBUTION_VALUE:贡献值;SPELL_BALANCE:拼团收益;CONTRIBUTION_BALANCE:拼团收益;LOVE_BALANCE:爱心收益;SHARE_BALANCE:分享收益;}", replace = {"余额_BALANCE", "拼购券_COUPON", "拼团值_SPELL_VALUE", "贡献值_CONTRIBUTION_VALUE", "拼团收益_SPELL_BALANCE", "拼团收益_CONTRIBUTION_BALANCE", "爱心收益_LOVE_BALANCE", "分享收益_SHARE_BALANCE",  "_null"})
    private WalletType walletType;

    /**
     * 可用余额
     */
    @ApiModelProperty(value = "可用余额")
    @NotNull(message = "可用余额不能为空")
    @TableField("avlb_balance")
    @Excel(name = "可用余额")
    private Long avlbBalance;

    /**
     * 冻结余额
     */
    @ApiModelProperty(value = "冻结余额")
    @NotNull(message = "冻结余额不能为空")
    @TableField("fronzen_balance")
    @Excel(name = "冻结余额")
    private Long fronzenBalance;


    @TableField(exist = false)
    private Integer transferType;
    @TableField(exist = false)
    private Integer ajaxSpreadLogInType;
    @TableField(exist = false)
    private Integer ajaxSpreadLogOutType;

    @Builder
    public CustomerWallet(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, 
                    Long customerId, WalletType walletType, Long avlbBalance, Long fronzenBalance) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.customerId = customerId;
        this.walletType = walletType;
        this.avlbBalance = avlbBalance;
        this.fronzenBalance = fronzenBalance;
    }

}
